#ifndef DRLSECORE_H
#define DRLSECORE_H

#include "FilterOption.h"

class DRLSECore
{
public:
	DRLSECore();

	void DoDRLSE();

private:
	void Anisotropic_step2D(double *iMAP_1D, unsigned int *imgSize, Options_p *Options, double *SiMAP, int k);
	void Coherent_filter(double *iMAP_1D, unsigned int *imgSize, double *SiMAP);
	void gradient(unsigned char** imageM, unsigned int* imgSize);
	void imfilter1D_double(double *iMAP_1D, unsigned int *imgSize, double *H, int lengthH, double *jrow);
	void imfilter2D_double(double *iMAP_1D, unsigned int *imgSize, double *H, int lengthH, double *jMAP_1D);
	void gradient2Dx(double *SiMAP, unsigned int *imgSize, double *Ux);
	void gradient2Dy(double *SiMAP, unsigned int *imgSize, double *Uy);
	void StructureTensor2D(double *Ux, double *Uy, double *Jxx, double *Jxy,double *Jyy, unsigned int *imgSize, double rho0, int kernel_size);
	void EigenVector2D(double *Jxx, double *Jxy, double *Jyy, unsigned int *imgSize, double **V);
	void ConstructDiffusionTensor2D(double **V, double *Dxx, double *Dxy, double *Dyy, double *gradA, unsigned int *imgSize, Options_p *Options);
	void Diffusion_scheme_2D_standard(double *SiMAP, double *Dxx, double *Dxy, double *Dyy, unsigned int *imgSize, Options_p *Options);
	void Diffusion_scheme_2D_implicit(double *SiMAP, double *Dxx, double *Dxy, double *Dyy,  unsigned int *imgSize, Options_p *Options);
	void drlse_edge(double *Phi, double *g, double lambda, double mu, double alfa, double epsilon, double timestep, int iter_inner, char potentialFunction, unsigned int *imgSize);
	void contour(double *iMAP_1D, double *Phi, unsigned int *imgSize);
	void NeumannBoundCond(double *Phi, unsigned int *imgSize);
	double *divergence(double *Nx, double *Ny, unsigned int *imgSize);
	double *distReg_p2(double *Phi, unsigned int *imgSize);
	void del2(double * Phi, double *Lap , unsigned int *imgSize);
	double *Dirac(double *Phi, double epsilon, unsigned int *imgSize);
	void GradientM(double *SiMAP, unsigned int *imgSize, double *Ux, double *Uy);
	void GaussianFiltering2D_double(double *iMAP_1D, unsigned int *imgSize, double sigma, int kernel_size, double *SiMAP);
};

#endif // DRLSECORE_H
